#include <stdio.h>
#include <string.h>

void my_strncpy(char *dest, char *src, int num){
    
}

int main() 
{
    char a[] = "asdfg";
    char b[] = "qqqq";
    // printf("%s \n", a);
    // printf("%s \n", b);
    strncpy(a,b,1);

    printf("a: %s \n", a); // 输出qsdfg
    printf("b: %s \n", b); // 输出 qqqq  与原始数组大小有关

    char arr1[] = "I LOVE YOU";
    char arr2[] = "SORRY";
    strncpy(arr1, arr2, 5);
    //经过函数My_strncpy后 ，arr1里应该是字符串 SORRYE YOU
    printf("arr1: %s\n", arr1);
    printf("arr2: %s\n", arr2);

    return 0; // 返回 0
}
